package net.jmchilton.spring.collect.spec;

import java.io.File;

/**
 * This program takes in a namespace spec XML file with
 * imported classes and specs and writes out another file
 * with neither by added the contents of imported specs and
 * fully qualifying all imported class references.
 *  
 * @author John Chilton
 * 
 */
public class SchemaExpander {
  
  /**
   * See class documentation.
   * 
   * @param args Directory, spec file, and output file. 
   */
  public static void main(final String[] args) {
    System.out.println("Loading and expanding specification");
    final NamespaceExpander expander = new NamespaceExpander(new File(args[0]), args[1]);
    System.out.println("Writing expanded specification without imports");
    NamespaceXmlUtils.writeNamespace(new File(args[2]), expander.getExpandedNamespace());    
  }
}
